package com.project;

import lombok.Data;

/**
 * Created by 卢泓佚  414814103@qq.com on 2021/8/19
 */
@Data
public class ResultVO {
    private int code = 1;//返回值 0-成功，1-失败
    private String info = "error";//返回信息

    public static ResultVO getResultVo(boolean flag,String ok,String error){
        ResultVO resultVO = new ResultVO();
        if(flag){
            resultVO.setCode(0);
            resultVO.setInfo(ok);
            return  resultVO;
        }
        resultVO.setInfo(error);
        return resultVO;
    }

    public static ResultVO ResultVoOK(String ok){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(0);
        resultVO.setInfo(ok);
        return  resultVO;
    }

    public static ResultVO hasNoPower(){
        ResultVO resultVO = new ResultVO();
        resultVO.setInfo("您没有该权限");
        return resultVO;
    }
}
